package com.woniuxy.stage3demo.service.gy.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.stage3demo.bean.gy.PrRepaymentInfoBean;
import com.woniuxy.stage3demo.bean.gy.UserDemo;
import com.woniuxy.stage3demo.mapper.gy.OverduePrRepaymentInfoMapper;
import com.woniuxy.stage3demo.service.gy.OverduePrRepaymentInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2020/12/14 9:27
 */
@Service
@Transactional(readOnly = true)
public class OverduePrRepaymentInfoServiceImpl implements OverduePrRepaymentInfoService {
    @Resource
    private OverduePrRepaymentInfoMapper overduePrRepaymentInfoMapper;
    @Override
    public PageInfo<PrRepaymentInfoBean> findAll(int pageNum, int pageSize, UserDemo userDemo) {
        return PageHelper.startPage(pageNum,pageSize).doSelectPageInfo(()->overduePrRepaymentInfoMapper.findAll(userDemo));
    }

    //查询本月提现还款的人数
    @Override
    public int findCountMonth() {
        return overduePrRepaymentInfoMapper.findCountMonth();
    }
    //查询本年提现还款的人数
    @Override
    public int findCountYear() {
        return overduePrRepaymentInfoMapper.findCountYear();
    }

    //查询本月提现还款的金额
    @Override
    public List<Integer> findMoneyMonth() {
        return overduePrRepaymentInfoMapper.findMoneyMonth();
    }

    //查询本年提现还款的金额
    @Override
    public List<Integer> findMoneyYear() {
        return overduePrRepaymentInfoMapper.findMoneyYear();
    }
}
